home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / apps / database / postgres / postgre4.z / postgre4 / newconf / postgres.mk < prev    next >
Encoding:
Text File  |  1992-08-27  |  8.2 KB  |  329 lines

  1. #---------------
  2. #  main postgres makefile.
  3. #  - this should be kept real clean as it is in the critical
  4. #    path for compilation and the smaller it is, the faster compiles
  5. #    will run.
  6. #
  7. #  Note: if $DEVELOPMENT is 't' then intermediate .o and .d files are not 
  8. #       automatically removed when the target is finished.  
  9. #
  10. #     if not set by the user, $DEVELOPMENT is set by Make to 'f'.
  11. #        if the -development option is specified on the Make command line,
  12. #     then $DEVELOPMENT is set to 't' 
  13. #
  14. #       if $STRIPOBJS is 't' then targets are stripped after compilation.
  15. #     This defaults to 'f' by Make.
  16. #
  17. # $Header: /private/postgres/newconf/RCS/postgres.mk,v 1.31 1992/07/20 20:13:43 mao Exp $
  18. #---------------
  19.  
  20. #include "config.mk"
  21. #include "port.mk"
  22. #include "FILES/$*"
  23. #include "defaults.mk"
  24. #include "DEPS/$*"
  25.  
  26. .SUFFIXES: .d .c .o .lex .y
  27.  
  28. PURIFY=    /usr/local/purify/purify
  29.  
  30. # ----------------
  31. # targets
  32. # ----------------
  33. ALLMODS = $(OD)/ACCESS.o $(OD)/COMMANDS.o $(OD)/EXECUTOR.o $(OD)/LIB.o \
  34.     $(OD)/BEPQ.o $(OD)/MAIN.o $(OD)/PARSER.o $(OD)/PLANNER.o \
  35.     $(OD)/PORT.o $(OD)/REWRITE.o $(OD)/RULES.o $(OD)/STORAGE.o \
  36.     $(OD)/TCOP.o $(OD)/UTIL.o $(OD)/BOOTSTRAP.o $(OD)/INH.o 
  37.  
  38. ALLDEPS = ACCESS.d COMMANDS.d EXECUTOR.d LIB.d BEPQ.d MAIN.d PARSER.d \
  39.     PLANNER.d PORT.d REWRITE.d RULES.d STORAGE.d BOOTSTRAP.d TCOP.d UTIL.d 
  40.  
  41. ALLOBJS = $(AMOBJS) $(COMMANDS) $(EXECOBJS) $(LIBOBJS) $(BEPQOBJS) \
  42.     $(MAINOBJS) $(PARSEROBJS) $(PLANNEROBJS) $(PORTOBJS) \
  43.     $(REWRITEOBJS) $(RULEOBJS) $(STORAGEOBJS) $(TCOPOBJS) \
  44.     $(BOOTSTRAPOBJS) $(INH_OBJ) $(UTILOBJS)
  45.  
  46. # ----------------
  47. # access methods
  48. # ----------------
  49. ACCESS.o:    $(OD)/ACCESS.o
  50.  
  51. $(OD)/ACCESS.o: $(AMOBJS)
  52.     @ ld -r -o $(OD)/ACCESS.o $(AMOBJS)
  53.     @ echo Module ACCESS done
  54.  
  55. ACCESS.d: $(AMDEPS)
  56.     @ cat $(AMDEPS) > ACCESS.d
  57.     @ mv ACCESS.d $(TREE)/newconf/DEPS
  58.     @ sh -c 'if (test $$DEVELOPMENT = "f" ) then \
  59.             rm -f $(AMDEPS); \
  60.          else true; fi'
  61.     @ echo ACCESS dependencies done
  62.  
  63. # ----------------
  64. # special commands
  65. # ----------------
  66. COMMANDS.o:    $(OD)/COMMANDS.o
  67.  
  68. $(OD)/COMMANDS.o: $(COMMANDS)
  69.     @ ld -r -o $(OD)/COMMANDS.o $(COMMANDS)
  70.     @ echo Module COMMANDS done
  71.  
  72. COMMANDS.d: $(COMMANDSDEPS)
  73.     @ cat $(COMMANDSDEPS) > COMMANDS.d
  74.     @ mv COMMANDS.d $(TREE)/newconf/DEPS
  75.     @ sh -c 'if (test $$DEVELOPMENT = "f" ) then \
  76.             rm -f $(COMMANDSDEPS); \
  77.          else true ; fi'
  78.     @ echo COMMANDS dependencies done
  79.  
  80. # ----------------
  81. # run time executor
  82. # ----------------
  83. EXECUTOR.o:    $(OD)/EXECUTOR.o
  84.  
  85. $(OD)/EXECUTOR.o: $(EXECOBJS)
  86.     @ ld -r -o $(OD)/EXECUTOR.o $(EXECOBJS)
  87.     @ echo Module EXECUTOR done
  88.  
  89. EXECUTOR.d: $(EXECDEPS)
  90.     @ cat $(EXECDEPS) > EXECUTOR.d
  91.     @ mv EXECUTOR.d $(TREE)/newconf/DEPS
  92.     @ sh -c 'if (test $$DEVELOPMENT = "f" ) then \
  93.             rm -f $(EXECDEPS); \
  94.          else true ; fi'
  95.     @ echo EXECUTOR dependencies done
  96.  
  97. # ----------------
  98. # library routines
  99. # ----------------
  100. LIB.o:    $(OD)/LIB.o
  101.  
  102. $(OD)/LIB.o: $(LIBOBJS)
  103.     @ ld -r -o $(OD)/LIB.o $(LIBOBJS)
  104.     @ echo Module LIB done
  105.  
  106. LIB.d: $(LIBDEPS)
  107.     @ cat $(LIBDEPS) > LIB.d
  108.     @ mv LIB.d $(TREE)/newconf/DEPS
  109.     @ sh -c 'if (test $$DEVELOPMENT = "f" ) then \
  110.             rm -f $(LIBDEPS); \
  111.          else true ; fi'
  112.     @ echo LIB dependencies done
  113.  
  114. # ----------------
  115. # backend libpq routines
  116. # ----------------
  117. BEPQ.o:    $(OD)/BEPQ.o
  118.  
  119. $(OD)/BEPQ.o: $(BEPQOBJS)
  120.     @ ld -r -o $(OD)/BEPQ.o $(BEPQOBJS)
  121.     @ echo Module BEPQ done
  122.  
  123. BEPQ.d: $(BEPQDEPS)
  124.     @ cat $(BEPQDEPS) > BEPQ.d
  125.     @ mv BEPQ.d $(TREE)/newconf/DEPS
  126.     @ sh -c 'if (test $$DEVELOPMENT = "f" ) then \
  127.             rm -f $(BEPQDEPS); \
  128.          else true ; fi'
  129.     @ echo BEPQ dependencies done
  130.  
  131. # ----------------
  132. # main() module
  133. # ----------------
  134. MAIN.o:    $(OD)/MAIN.o
  135.  
  136. $(OD)/MAIN.o:    $(MAINOBJS)
  137.     @ ld -r -o $(OD)/MAIN.o $(MAINOBJS)
  138.     @ echo Module MAIN done
  139.  
  140. MAIN.d:    $(MAINDEPS)
  141.     @ cat $(MAINDEPS) > MAIN.d
  142.     @ mv MAIN.d $(TREE)/newconf/DEPS
  143.     @ sh -c 'if (test $$DEVELOPMENT = "f" ) then \
  144.             rm -f $(MAINDEPS); \
  145.          else true ; fi'
  146.     @ echo MAIN dependencies done
  147.  
  148. # ----------------
  149. # query parser
  150. # ----------------
  151. PARSER.o:    $(OD)/PARSER.o
  152.  
  153. $(OD)/PARSER.o: $(PARSEROBJS)
  154.     @ ld -r -o $(OD)/PARSER.o $(PARSEROBJS)
  155.     @ echo Module PARSER done
  156.  
  157. PARSER.d: $(PARSERDEPS)
  158.     @ cat $(PARSERDEPS) > PARSER.d
  159.     @ mv PARSER.d $(TREE)/newconf/DEPS
  160.     @ sh -c 'if (test $$DEVELOPMENT = "f" ) then \
  161.             rm -f $(PARSERDEPS); \
  162.          else true ; fi'
  163.     @ echo PARSER dependencies done
  164.  
  165. # ----------------
  166. # query planner
  167. # ----------------
  168. PLANNER.o:    $(OD)/PLANNER.o
  169.  
  170. $(OD)/PLANNER.o: $(PLANNEROBJS)
  171.     @ ld -r -o $(OD)/PLANNER.o $(PLANNEROBJS)
  172.     @ echo Module PLANNER done
  173.  
  174. PLANNER.d: $(PLANNERDEPS)
  175.     @ cat $(PLANNERDEPS) > PLANNER.d
  176.     @ mv PLANNER.d $(TREE)/newconf/DEPS
  177.     @ sh -c 'if (test $$DEVELOPMENT = "f" ) then \
  178.             rm -f $(PLANNERDEPS); \
  179.          else true ; fi'
  180.     @ echo PLANNER dependencies done
  181.  
  182. # ----------------
  183. # port specific stuff
  184. # ----------------
  185. PORT.o:    $(OD)/PORT.o
  186. $(OD)/PORT.o: $(PORTOBJS)
  187.     @ ld -r -o $(OD)/PORT.o $(PORTOBJS)
  188.     @ echo Module PORT done
  189.  
  190. PORT.d: $(PORTDEPS)
  191.     @ cat $(PORTDEPS) > PORT.d
  192.     @ mv PORT.d $(TREE)/newconf/DEPS
  193.     @ sh -c 'if (test $$DEVELOPMENT = "f" ) then \
  194.             rm -f $(PORTDEPS); \
  195.          else true ; fi'
  196.     @ echo PORT dependencies done
  197.  
  198. # ----------------
  199. # rewrite rule manager
  200. # ----------------
  201. REWRITE.o:    $(OD)/REWRITE.o
  202.  
  203. $(OD)/REWRITE.o: $(REWRITEOBJS)
  204.     @ ld -r -o $(OD)/REWRITE.o $(REWRITEOBJS)
  205.     @ echo Module REWRITE done
  206.  
  207. REWRITE.d: $(REWRITEDEPS)
  208.     @ cat $(REWRITEDEPS) > REWRITE.d
  209.     @ mv REWRITE.d $(TREE)/newconf/DEPS
  210.     @ sh -c 'if (test $$DEVELOPMENT = "f" ) then \
  211.             rm -f $(REWRITEDEPS); \
  212.          else true ; fi'
  213.     @ echo REWRITE dependencies done
  214.  
  215. # ----------------
  216. # tuple rule manager
  217. # ----------------
  218. RULES.o:    $(OD)/RULES.o
  219.  
  220. $(OD)/RULES.o: $(RULEOBJS)
  221.     @ ld -r -o $(OD)/RULES.o $(RULEOBJS)
  222.     @ echo Module RULES done
  223.  
  224. RULES.d: $(RULEDEPS)
  225.     @ cat $(RULEDEPS) > RULES.d
  226.     @ mv RULES.d $(TREE)/newconf/DEPS
  227.     @ sh -c 'if (test $$DEVELOPMENT = "f" ) then \
  228.             rm -f $(RULEDEPS); \
  229.          else true ; fi'
  230.     @ echo RULES dependencies done
  231.  
  232. # ----------------
  233. # storage manager
  234. # ----------------
  235. STORAGE.o:    $(OD)/STORAGE.o
  236.  
  237. $(OD)/STORAGE.o: $(STORAGEOBJS)
  238.     @ ld -r -o $(OD)/STORAGE.o $(STORAGEOBJS)
  239.     @ echo Module STORAGE done
  240.  
  241. STORAGE.d: $(STORAGEDEPS)
  242.     @ cat $(STORAGEDEPS) > STORAGE.d
  243.     @ mv STORAGE.d $(TREE)/newconf/DEPS
  244.     @ sh -c 'if (test $$DEVELOPMENT = "f" ) then \
  245.             rm -f $(STORAGEDEPS); \
  246.          else true ; fi'
  247.     @ echo STORAGE dependencies done
  248.  
  249. # ----------------
  250. # traffic cop
  251. # ----------------
  252. TCOP.o:    $(OD)/TCOP.o
  253.  
  254. $(OD)/TCOP.o: $(TCOPOBJS)
  255.     @ ld -r -o $(OD)/TCOP.o $(TCOPOBJS)
  256.     @ echo Module TCOP done
  257.  
  258. TCOP.d: $(TCOPDEPS)
  259.     @ cat $(TCOPDEPS) > TCOP.d
  260.     @ mv TCOP.d $(TREE)/newconf/DEPS
  261.     @ sh -c 'if (test $$DEVELOPMENT = "f" ) then \
  262.             rm -f $(TCOPDEPS); \
  263.          else true ; fi'
  264.     @ echo TCOP dependencies done
  265.  
  266. # ----------------
  267. # The Bootstrapper
  268. # ----------------
  269. BOOTSTRAP.o: $(OD)/BOOTSTRAP.o
  270.  
  271. $(OD)/BOOTSTRAP.o: $(BOOTSTRAPOBJS)
  272.     @ ld -r -o $(OD)/BOOTSTRAP.o $(BOOTSTRAPOBJS)
  273.     @ echo Module BOOTSTRAP done
  274.  
  275. # ----------------
  276. # system utilities
  277. # ----------------
  278. UTIL.o:    $(OD)/UTIL.o
  279.  
  280. $(OD)/UTIL.o: $(UTILOBJS)
  281.     @ ld -r -o $(OD)/UTIL.o $(UTILOBJS)
  282.     @ echo Module UTIL done
  283.  
  284. UTIL.d: $(UTILDEPS)
  285.     @ cat $(UTILDEPS) > UTIL.d
  286.     @ mv UTIL.d $(TREE)/newconf/DEPS
  287.     @ sh -c 'if (test $$DEVELOPMENT = "f" ) then \
  288.             rm -f $(UTILDEPS); \
  289.          else true ; fi'
  290.     @ echo UTIL dependencies done
  291.  
  292. # ----------------
  293. # node inheritance support stuff.
  294. # note: dependencies for these are hard coded.
  295. # ----------------
  296. INH.o:    $(OD)/INH.o
  297.  
  298. $(OD)/INH.o: $(INH_OBJ)
  299.     @ ld -r -o $(OD)/INH.o $(INH_OBJ)
  300.     @ echo Module INH done
  301.  
  302. # ----------------
  303. # the final product.. $(OD)/support/postgres
  304. # ----------------
  305. POSTGRES.o: $(ALLMODS)
  306.     @ echo linking postgres
  307.     @ $(CC) $(PORTLDFLAGS) $(LDFLAGS) -o $(OD)/support/postgres $(ALLMODS) $(LIBS)
  308.     @ sh -c 'if (test $$STRIPOBJS = "t" ) then \
  309.             strip $(OD)/support/postgres ; \
  310.          else true ; fi'
  311.     @ echo linking postgres completed
  312.  
  313. # ----------------
  314. # the final pure product.. $(OD)/support/postgres
  315. # ----------------
  316. POSTPURE.o: $(ALLMODS)
  317.     @ echo purifying postgres
  318.     @ $(PURIFY) $(CC) $(PORTLDFLAGS) $(LDFLAGS) -o $(OD)/support/postgres $(ALLOBJS) $(LIBS)
  319.     @ sh -c 'if (test $$DEVELOPMENT = "f" ) then \
  320.             rm -f $(ALLMODS); \
  321.          else true ; fi'
  322.     @ sh -c 'if (test $$STRIPOBJS = "t" ) then \
  323.             strip $(OD)/support/postgres ; \
  324.          else true ; fi'
  325.     @ echo purifying postgres completed
  326.  
  327. POSTGRES.d: $(ALLDEPS)
  328.     @ echo postgres dependencies complete
  329.